import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * flock模块-评论信息
 */
@Entity('flock_comment')
export class FlockCommentEntity extends BaseEntity {
  @Column({ comment: '评论内容', type: 'text' })
  content: string;

  @Column({ comment: '评论时间', type: 'datetime' })
  commentTime: Date;

  @Index()
  @Column({ comment: '评论者', length: 100 })
  commenter: string;

  @Index()
  @Column({ comment: '评论对象', length: 100 })
  commentTarget: string;

  @Column({ comment: '点赞数', default: 0 })
  likes: number;

  @Column({ comment: '回复数', default: 0 })
  replies: number;

  @Column({ comment: '用户头像', nullable: true, type: 'text' })
  userAvatar: string;

  @Column({ comment: '视频', nullable: true, type: 'text' })
  video: string;

  @Column({ comment: '状态 0-禁用 1-启用', default: 1 })
  status: number;

  @Column({ comment: '类型 0-普通 1-置顶', default: 0, type: 'tinyint' })
  type: number;
}
